<template>
	<view class="menu-section">
		<!-- 商家信息 -->
		<view class="menu-item" @click="goToEditInfo">
			<view class="menu-left">
				<uv-icon name="info-circle" size="40" color="#3c9cff"></uv-icon>
				<text>商家信息</text>
			</view>
			<uv-icon name="arrow-right" size="27" bold></uv-icon>
		</view>

		<!-- 我的店铺 -->
		<view class="menu-item" @click="goToShop">
			<view class="menu-left">
				<uv-icon name="shop_fill" size="40" color="#3c9cff" custom-prefix="custom-icon"></uv-icon>
				<text>我的店铺</text>
			</view>
			<uv-icon name="arrow-right" size="27" bold></uv-icon>
		</view>

		<!--二维码生成 -->
		<view class="menu-item" @click="goToQRCode">
			<view class="menu-left">
				<uv-icon name="erweima" size="40" color="#ff9a2f" custom-prefix="custom-icon"></uv-icon>
				<text>二维码生成</text>
			</view>
			<uv-icon name="arrow-right" size="27" bold></uv-icon>
		</view>

		<!-- 核销早餐券 -->
		<view class="menu-item" @click="goToVerifyCoupon">
			<view class="menu-left">
				<uv-icon name="scan" size="40" color="#19be6b"></uv-icon>
				<text>核销餐券</text>
			</view>
			<uv-icon name="arrow-right" size="27" bold></uv-icon>
		</view>

		<!-- 券务统计 -->
		<view class="menu-item" @click="goToCouponStats">
			<view class="menu-left">
				<uv-icon name="order" size="40" color="#3c9cff"></uv-icon>
				<text>券务统计</text>
			</view>
			<uv-icon name="arrow-right" size="27" bold></uv-icon>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'MerchantMenuGroup',
		props: {
			merchantId: {
				type: [String, Number],
				required: true
			}
		},
		methods: {
			goToEditInfo() {
				uni.navigateTo({
					url: '/subpkg/edit_merchant_info/edit_merchant_info'
				})
			},
			goToQRCode() {
				uni.navigateTo({
					url: '/subpkg/create_qccode/create_qccode'
				})
			},
			goToVerifyCoupon() {
				uni.navigateTo({
					url: `/subpkg/verify_breakfast_coupon/verify_breakfast_coupon?merchantId=${this.merchantId}`
				})
			},
			goToCouponStats() {
				uni.navigateTo({
					url: `/subpkg/coupon_stats/coupon_stats?merchantId=${this.merchantId}`
				})
			},
			goToShop() {
				uni.navigateTo({
					url: `/subpkg/my_shop/my_shop?merchantId=${this.merchantId}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.menu-section {
		background: #fff;
		margin: 20rpx;
		border-radius: 16rpx;
		padding: 0 20rpx;
		box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);

		.menu-item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 30rpx 20rpx;
			border-bottom: 1rpx solid #e0e0e0;

			&:last-child {
				border-bottom: none;
			}

			&:active {
				background-color: #f5f5f5;
			}

			.menu-left {
				display: flex;
				align-items: center;
				gap: 20rpx;

				text {
					font-size: 28rpx;
					color: #333;
				}

				.custom-icon-car {
					font-size: 44rpx;
				}
			}
		}
	}
</style>